package org.gzc.util;

public class PagingResultUtil<T> {
    private int code;
    private String msg;
    private T data;
    private int currPage = 1;
    private int limit = 10;
    private int count = 0;

    public static PagingResultUtil success = new PagingResultUtil<>(0, "success");
    public static PagingResultUtil failed = new PagingResultUtil<>(-1, "error");

    public PagingResultUtil(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public PagingResultUtil<T> setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public PagingResultUtil<T> setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getData() {
        return data;
    }

    public PagingResultUtil<T> setData(T data) {
        this.data = data;
        return this;
    }

    public int getCurrPage() {
        return currPage;
    }

    public PagingResultUtil<T> setCurrPage(int currPage) {
        this.currPage = currPage;
        return this;
    }

    public int getLimit() {
        return limit;
    }

    public PagingResultUtil<T> setLimit(int limit) {
        this.limit = limit;
        return this;
    }

    public int getCount() {
        return count;
    }

    public PagingResultUtil<T> setCount(int count) {
        this.count = count;
        return this;
    }
}
